<?php
/**
 * @author Nguyễn Sơn Tùng <sontung.x305@gmail.com> <Y!M: terminator_nst> <Skype : joker.x305>
 * @version: 1.0
 * @copyright fteam.vn
 * Date: 16/04/2013
 * Time: 09:05
 */

class FBeginRequest {
    public function startEvent($event) {
        // Gzip
        if(settings()->get('system','gzip')) {
             ob_start("ob_gzhandler");
        }
        // Set timezone
        $timezone = settings()->get('system','time_zone');
        if(isset($timezone)) {
            app()->timeZone = $timezone;
        }
    }
    public function endEvent($event) {
        // EndGzip
        if(settings()->get('system','gzip')) {
            if (ob_get_level()>1) {ob_end_flush();}
        }
    }
}